package com.yn.admin.zy;

import com.yn.common.page.BasePage;
import com.yn.common.request.sc.PageParamRequest;
import com.yn.common.response.driver.ZyDriverContactResponse;
import com.yn.common.response.sc.BaseResult;
import com.yn.common.response.zyorder.ZyOrderQuoteResponse;
import com.yn.service.service.ZyOrderService;
import com.yn.service.zy.InspectionOrderService;
import com.yn.service.zy.model.dto.InspectionOrderDTO;
import com.yn.service.zy.model.dto.ZyOrderDTO;
import com.yn.service.zy.model.query.InspectionOrderQuery;
import com.yn.service.zy.model.query.ZyOrderQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName: OrderManageController
 * @Description: 订单管理Controller
 * @Author: ym
 * @Date: 2025/5/10 10:27
 **/
@RestController
@RequestMapping("/ordermanage")
@Api(tags = "转运订单管理")
public class OrderManageController {

    @Resource
    private ZyOrderService zyOrderService;
    @Resource
    private InspectionOrderService inspectionOrderService;

  /*  @ApiOperation(value = "分页获取用车订单列表")
    @RequestMapping(value = "/zy/list-page", method = RequestMethod.GET)
    public BaseResult listPage(ZyOrderQuery query, BasePage basePage) {
        return BaseResult.success(zyOrderService.listPage(query, basePage));
    }*/

    /**
     * 管理端分页获取用车订单列表
     * @param query
     * @param pageRequest
     * @return
     */
    @ApiOperation(value = "分页获取用车订单列表")
    @RequestMapping(value = "/zy/list-page", method = RequestMethod.GET)
    public BaseResult<BasePage<ZyOrderDTO>> listPage1(ZyOrderQuery query, PageParamRequest pageRequest) {
        return BaseResult.success(zyOrderService.listPage1(query, pageRequest));
    }

    @ApiOperation(value = "获取用车订单详情")
    @RequestMapping(value = "/zy/detail", method = RequestMethod.GET)
    public BaseResult<ZyDriverContactResponse> getZyDetail(@ApiParam(value = "商户订单号") @RequestParam(value = "orderNo") String orderNo) {
        return BaseResult.success(zyOrderService.getOrderDetail(orderNo));
    }

    /*@ApiOperation(value = "分页获取检查项(影像)订单列表")
    @RequestMapping("/inspection/list-page")
    public BaseResult inspectionListPage(InspectionOrderQuery query, BasePage basePage) {
        return BaseResult.success(inspectionOrderService.listPage(query, basePage));
    }*/

    @ApiOperation(value = "分页获取检查项(影像)订单列表")
    @GetMapping("/inspection/list-page")
    public BaseResult<BasePage<InspectionOrderDTO>> inspectionListPage1(InspectionOrderQuery query, PageParamRequest pageRequest) {
        return BaseResult.success(inspectionOrderService.listPage1(query, pageRequest));
    }

    @ApiOperation(value = "获取检查项(影像)订单详情")
    @RequestMapping("/inspection/detail")
    public BaseResult inspectionDetail(@ApiParam(value = "商户订单号") @RequestParam(value = "orderNo") String orderNo) {
        return BaseResult.success(inspectionOrderService.getInspectionOrderDetail(orderNo));
    }
}
